/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package estate;

import java.util.HashMap;

interface AbstractUsersFactory {

    public User createUser(HashMap<String,Object> dane);
}
/**
 *
 * @author gacek
 */
public class UsersFactory implements AbstractUsersFactory{

    public User createUser(HashMap<String,Object> dane) {


        User u = new User();
        u.setLogin((String)dane.get("login"));
        u.setPesel((String)dane.get("pesel"));
        u.setAdditionalInf((String)dane.get("additionalInf"));
        u.setCity((String)dane.get("city"));
        u.setHouseNr((String)dane.get("houseNr"));
        u.setMail((String)dane.get("mail"));
        u.setUserTypes((UserTypes)dane.get("userType"));
        u.setNIP((String)dane.get("NIP"));
        u.setName((String)dane.get("name"));
        u.setPassword((String)dane.get("password"));
        u.setPhone((String)dane.get("phone"));
        u.setPostCode((String)dane.get("postCode"));
        u.setRegon((String)dane.get("regon"));
        u.setStreet((String)dane.get("street"));
        //u.setUserTypes((UserTypes)dane.get("userType"));
        return u;
    }

}
